Solar Plants
Contents
Solar Plants¶
Data Import¶
import pandas as pd
import matplotlib.pyplot as plt
import geopandas as gpd
from folium import plugins
import folium
pd.set_option('display.float_format', lambda x: '%0.4f' % x)
/Users/jnapolitano/venvs/finance/lib/python3.9/site-packages/geopandas/_compat.py:111: UserWarning: The Shapely GEOS version (3.10.2-CAPI-1.16.0) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.
warnings.warn(
US Power Plants Data¶
gisfilepath = "/Users/jnapolitano/Projects/gas.jnapolitano.io/source/data/Power_Plants.geojson"
powerplants_df = gpd.read_file(gisfilepath)
#Selecting only Operational Plants
powerplants_df=powerplants_df.loc[powerplants_df['STATUS'] == 'OP'].copy()
na = powerplants_df.COAL_USED.min()
powerplants_df.replace(na, 0 , inplace=True)
#powerplants_df = powerplants_df.to_crs(epsg=3857)
powerplants_df.describe()
| OBJECTID | LATITUDE | LONGITUDE | OPER_CAP | SUMMER_CAP | WINTER_CAP | PLAN_CAP | RETIRE_CAP | GEN_UNITS | PLAN_UNIT | RETIR_UNIT | COAL_USED | NGAS_USED | OIL_USED | NET_GEN | CAP_FACTOR | LINES | SOURCE_LAT | SOURC_LONG | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 | 8736.0000 |
| mean | 5709.4960 | 39.0405 | -95.0667 | 134.5691 | 123.2273 | 127.9356 | 1.5068 | 12.3725 | 2.3368 | 0.0144 | 0.2098 | 75285.8993 | 1351867.2459 | 3590.2573 | 466814.5072 | 0.0371 | 0.3489 | 39.0424 | -94.1651 |
| std | 3315.5893 | 5.5191 | 19.0667 | 367.0281 | 339.7523 | 350.9757 | 36.1032 | 100.9833 | 2.8505 | 0.1797 | 0.9739 | 555638.6353 | 6289781.4216 | 57026.9476 | 1813781.4037 | 12.5042 | 0.5880 | 5.5178 | 21.7038 |
| min | 1.0000 | 18.9737 | -171.7124 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | -3465212.0000 | -1141.5514 | 0.0000 | 18.9742 | -171.7124 |
| 25% | 2666.7500 | 35.1990 | -113.7045 | 2.7000 | 2.5000 | 2.4000 | 0.0000 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 2141.7500 | 0.0574 | 0.0000 | 35.1986 | -113.6161 |
| 50% | 5832.5000 | 39.4456 | -91.6117 | 9.6000 | 8.7500 | 8.8000 | 0.0000 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 11727.0000 | 0.2137 | 0.0000 | 39.4492 | -91.0609 |
| 75% | 8566.2500 | 42.4995 | -78.6045 | 74.8000 | 70.0000 | 72.0000 | 0.0000 | 0.0000 | 3.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 133402.5000 | 0.4291 | 1.0000 | 42.5003 | -78.2997 |
| max | 11810.0000 | 71.2921 | -67.4016 | 6809.0000 | 7079.0000 | 7079.0000 | 2200.0000 | 3623.0000 | 73.0000 | 5.0000 | 28.0000 | 10040760.0000 | 138014506.0000 | 4130642.0000 | 32377477.0000 | 4.6214 | 11.0000 | 71.2920 | 36.2439 |
Identifying the Solar Plants in the Dataset¶
#powerplants_df.PRIM_FUEL.unique()
#RC,WC,NUC
#Selecting only Operational Plants
#powerplants_df=powerplants_df.loc[powerplants_df['STATUS'] == 'OP'].copy()
#selecting coal plants
solar_plants = powerplants_df.loc[powerplants_df['PRIM_FUEL'] == 'SUN'].copy()
#concatenating coal type dfs into one
solar_plants.describe()
| OBJECTID | LATITUDE | LONGITUDE | OPER_CAP | SUMMER_CAP | WINTER_CAP | PLAN_CAP | RETIRE_CAP | GEN_UNITS | PLAN_UNIT | RETIR_UNIT | COAL_USED | NGAS_USED | OIL_USED | NET_GEN | CAP_FACTOR | LINES | SOURCE_LAT | SOURC_LONG | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 | 2834.0000 |
| mean | 7157.9675 | 37.7763 | -92.9739 | 10.4763 | 10.2730 | 10.0978 | 0.3627 | 0.1403 | 1.1401 | 0.0056 | 0.0106 | 0.0000 | 1134.2445 | 0.0000 | 16101.9108 | -0.1025 | 0.0212 | 37.7813 | -91.8098 |
| std | 3684.7414 | 4.1140 | 19.5182 | 30.1760 | 29.9266 | 29.7078 | 11.3019 | 5.5945 | 1.0293 | 0.0919 | 0.1546 | 0.0000 | 18862.3855 | 0.0000 | 62440.4517 | 3.9574 | 0.1464 | 4.1213 | 22.5932 |
| min | 116.0000 | 20.7667 | -159.5817 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | -2611.0000 | -114.1551 | 0.0000 | 20.7667 | -159.5817 |
| 25% | 3190.5000 | 34.8295 | -116.5268 | 1.5000 | 1.5000 | 1.4000 | 0.0000 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 1004.2500 | 0.0528 | 0.0000 | 34.8240 | -116.4832 |
| 50% | 9028.5000 | 36.7623 | -83.1576 | 3.0000 | 3.0000 | 2.8500 | 0.0000 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 3275.5000 | 0.1667 | 0.0000 | 36.7784 | -82.1681 |
| 75% | 10131.7500 | 41.3015 | -76.3683 | 5.0000 | 5.0000 | 5.0000 | 0.0000 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 8676.0000 | 0.2081 | 0.0000 | 41.3208 | -76.1351 |
| max | 11810.0000 | 47.5475 | -69.6717 | 585.9000 | 585.9000 | 585.9000 | 400.0000 | 290.0000 | 16.0000 | 3.0000 | 6.0000 | 0.0000 | 462108.0000 | 0.0000 | 1265760.0000 | 4.6214 | 2.0000 | 47.5475 | 33.6561 |
Solar Plants Interactive Map¶
solar_map = solar_plants.explore(column="NET_GEN", # make choropleth based on "BoroName" column
popup=True, # show all values in popup (on click)
tiles="Stamen Terrain", # use "CartoDB positron" tiles
cmap="Set1", # use "Set1" matplotlib colormap
style_kwds=dict(color="black"),
marker_kwds= dict(radius=6),# use black outline)
scheme = 'EqualInterval',
k = 5
)
solar_map
Make this Notebook Trusted to load map: File -> Trust Notebook
Solar Plant Density Interactive Map¶
solar_heat_data = [[point.xy[1][0], point.xy[0][0]] for point in solar_plants.geometry ]
#
solar_density_map = folium.Map(location = [30, -90], tiles='Cartodb dark_matter', zoom_start = 4)
solar_heat_layer = plugins.HeatMap(data = solar_heat_data, show=True)
solar_heat_layer.add_to(solar_density_map)
solar_density_map
Make this Notebook Trusted to load map: File -> Trust Notebook